package com.zhaungjie.base.utils;

/**
 * 数组工具类
 */
public class ArrayUtils {
    /**
     * 数组倒序
     */
    public static <T> T[] reverse(T[] array) {
        if (array == null) {
            return null;
        }
        int i = 0;
        int j = array.length - 1;
        T tmp;
        while (j > i) {
            tmp = array[j];
            array[j] = array[i];
            array[i] = tmp;
            j--;
            i++;
        }
        return array;
    }


}
